package public

import (
	"fmt"
	"math/rand"
	"time"
)

const (
	MchID                      string = "1629987067" //商户号
	AppId                      string = "wx7982ced31bc1af72"
	MchCertificateSerialNumber string = "39C834AB879F4FEC879D1D189E162FD7E2BE866A"
	MchAPIv3Key                string = "Pqswer123pWepErpweperpZxdahT6792" //商户APIv3秘钥
)

var Loc, _ = time.LoadLocation("Asia/Shanghai")

// GenerateOrderSn 生成订单号
func GenerateOrderSn(userId int64) string {
	now := time.Now()
	rand.Seed(time.Now().UnixNano())
	orderSn := fmt.Sprintf("%d%d%d%d%d%d%d%d",
		now.Year(), now.Month(), now.Day(), now.Hour(), now.Minute(), now.Nanosecond(), userId, rand.Intn(90)+10)
	return orderSn
}
